Getting started with Fins

Prerequisites

Fins runs on Pike 7.6 or higher. Pike 7.7 and a Bonjour ready system (such as MacOS X) will get you automatic announcement of your Fins apps. If you want to use XSLT templating, you'll need to install libxml, libxslt and the Public.Parser.XML2 module. To use Simple templates, you need to have pcre installed, and the _Regexp_PCRE module enabled in your Pike.

To create a new web application, simply copy the "default" directory. You'll probably want to customize all of the files in it, based on your needs.

The file layout is:

appname/       <-- the root of your Fins application.

   static/     <-- this tree contains static files, accessible from http://yoururl/static/
   templates/  <-- this tree contains template files, used with the View templating system
   classes/    <-- this tree is the core of your application. all of your pike classes should live here
   
               application.pike     <-- the main class that will contain your controllers and model
               controller.pike      <-- by default, this is the main controller. it's loaded into application.pike
               ...                  <-- your main controller can contain other sub-controllers. they should live in this directory, too

How do my requests get directed?

Any public functions present in your controller will be available as paths on your url; if no path is provided, the index method will be run. If you have a method called "boo" in your main controller, it will be available as "/boo". Any additional path past that will be sent as arguments to the method. If you have a controller class present within the main controller, it will also be available as a subfolder on your application url. For example, if you have a controller class called "gazonk" in your main controller, the sub-controller will be available as "/gazonk/". note that if you just choose "/gazonk", you'll automatically be redirected so that you're at the "index" level of that controller. Note that your index function can't receive "arguments", as they could potentially mask other methods.

Starting a Fins application

Right now, the only way to run a Fins application is with the built in 
webserver (not that it's that bad). To start up your application, simply 
run the fin_serve program:

pike -Mlib fin_serve [port] [appname [config]] 

where port is the port number your Fins application should run on, which 
defaults to port 8080. appname is the name of the app you'd like to run. 
it defaults to "default". config is the name of a configuration you'd 
like to use, which is loaded from appname/config/config.cfg. this value 
defaults to dev, which loads config/dev.cfg. if you have a Bonjour 
subsystem and Pike 7.7, you'll get automatic bookmarks in your Bonjour 
aware applications (such as Safari).

Interactive Fins

fin_serve also supports an interactive "hilfe" mode. This is just like 
regular hilfe, only your application is loaded and initialized, so that 
you can call functions within your application, such as the model, 
interactively.

you can access your application through the "application" contstant.
